<template>
  <div class="employees">
    <el-card class="top-card">
      <div class="top">
        <div class="TodayNewMessage">
          <div class="Circular">
            <span>{{ list.increment_users }}</span>
          </div>
          <div>今日新增用户</div>
        </div>

        <div class="TodayNewMessage">
          <div class="Circular">
            <span>{{ list.total_users }}</span>
          </div>
          <div>总用户量</div>
        </div>

        <div class="TodayNewMessage">
          <div class="Circular">
            <span> {{ list.increment_questions }}</span>
          </div>
          <div>新增试题</div>
        </div>

        <div class="TodayNewMessage">
          <div class="Circular">
            <span> {{ list.total_questions }}</span>
          </div>
          <div>总试题量</div>
        </div>

        <div class="TodayNewMessage">
          <div class="Circular">
            <span> {{ list.total_done_questions }} </span>
          </div>
          <div>总刷题量</div>
        </div>

        <div class="TodayNewMessage">
          <div class="Circular">
            <span>{{ list.personal_questions }}</span>
          </div>
          <div>人均刷题量</div>
        </div>
      </div>
    </el-card>
    <!-- 导入Chart组件 -->
    <Chart />
  </div>
</template>

<script>
import Chart from './chart.vue' // 引入同级组件
import { dataTitlePost } from '@/api/adshboard'// 导入面版数据接口dataTitle  dataTitlePost

export default {
  components: {
    Chart
  },
  /*  */
  data() {
    return {
      list: []
    }
  },
  created() {
    this.getData()
  },
  methods: {
    async getData() {
      const res = await dataTitlePost()
      this.list = res.data.data
    }
  }
}
</script>

<style lang="scss" scoped>
.employees {
  padding: 20px;
  .top-card {
    margin-bottom: 2px;
  }
  .top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    .TodayNewMessage {
      padding: 2px;
      margin: auto;
      text-align: center;
      .Circular {
        width: 100px;
        height: 100px;
        border-radius: 50px;
        border: 2px solid green;
        margin-bottom: 8px;
        span {
          font-size: 18px;
          display: inline;
          position: relative;
          top: 40px;
        }
      }
    }
  }
}
</style>
